<?php
if($_SERVER['REQUEST_METHOD']==='POST'){
    //--
    include('tryPHP/tryLibrary/captcha/import.php');
    $captchaValue=Captcha2::GetSessionValue();
    if(strtolower($captchaValue)!==strtolower(trim(post('captcha')))){
        jsAlert('验证码填写错误，请重新填写。');
        jsHistory(-1);
        return;
    }
    else{
        Captcha2::DeleteSession();
    }
    //--
    $data=array(
        'area'=>post('area'),
        'budget'=>post('budget'),
        'year'=>post('year'),
        'month'=>post('month'),
        'start_city'=>post('start_city'),
        'numbers'=>post('numbers'),
        'adult'=>post('adult'),
        'children'=>post('children'),
        'baby'=>post('baby'),
        'linkman'=>post('linkman'),
        'phone'=>post('phone'),
        'qq'=>post('qq'),
        'email'=>post('email'),
        'explain'=>post('explain')
    );
    //--
    $data=array_map('htmlentities',$data);
    //--
    $db->Insert('customization',$data);
    echo '预定成功，正在跳转请稍候..';
    header('refresh:2;url='.$_SERVER['HTTP_REFERER']);

}
else{
    header_http_invaild_method_post();
}